package com.minis.web.servlet.view;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.Map;

/**
 * View这个类的定位是前端展示，如果是JSP，就是吧数据填充到JSP中
 */
public interface View {
    void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response)
            throws Exception;

    default String getContentType() {
        return null;
    }
    void setContentType(String contentType);

    void setUrl(String url);
    String getUrl();

    void setRequestContextAttribute(String requestContextAttribute);
    String getRequestContextAttribute();
}
